<template>
  <div class="exception-page">
    <div class="exception-content">
      <a-result
        status="404"
        title="404"
        sub-title="抱歉，您访问的页面不存在"
      >
        <template #extra>
          <a-space>
            <a-button type="primary" @click="backHome">
              <template #icon>
                <icon-home />
              </template>
              返回首页
            </a-button>
            <a-button @click="goBack">
              <template #icon>
                <icon-undo />
              </template>
              返回上一页
            </a-button>
          </a-space>
        </template>
      </a-result>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
import { IconHome, IconUndo } from '@arco-design/web-vue/es/icon';

const router = useRouter();

// 返回首页
const backHome = () => {
  router.push('/');
};

// 返回上一页
const goBack = () => {
  router.go(-1);
};
</script>

<style lang="less" scoped>
.exception-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--color-bg-1);
}

.exception-content {
  max-width: 500px;
  padding: 24px;
}

.result {
  :deep(.arco-result-subtitle) {
    font-size: 16px;
  }
  
  :deep(.arco-space) {
    .arco-btn {
      min-width: 120px;
    }
  }
}
</style> 